DROP TABLE IF EXISTS jms_dm.dm_diff_customer_deliver_and_contribution_ratio_dt ;
create external table jms_dm.dm_diff_customer_deliver_and_contribution_ratio_dt
(
    networktype            string COMMENT '网点类型,区分代理,加盟,网点',
    timetype               string COMMENT '时间类型,区分日,周,月',
    date_time              string COMMENT '日期',
    agent_code             string COMMENT '代理区code ',
    agent_name             string COMMENT '代理区',
    fran_code              string COMMENT '加盟商名称',
    fran_name              string COMMENT '加盟商名称',
    network_code           string COMMENT '网点编码',
    network_name           string COMMENT '网点名称',
    total_customer         int COMMENT '总客户数',
    total_ticket           int COMMENT '总票数',
    a_total_customer_level int COMMENT 'A类客户数',
    a_ratio_customer_level double COMMENT 'A类客户数据占比',
    a_total_ticket_level   int COMMENT 'A类客户发货量',
    a_ratio_ticket_level   double COMMENT 'A类客户发件量占比',
    b_total_customer_level int COMMENT 'B类客户数',
    b_ratio_customer_level double COMMENT 'B类客户数据占比',
    b_total_ticket_level   int COMMENT 'B类客户发货量',
    b_ratio_ticket_level   double COMMENT 'B类客户发件量占比',
    c_total_customer_level int COMMENT 'C类客户数',
    c_ratio_customer_level double COMMENT 'C类客户数据占比',
    c_total_ticket_level   int COMMENT 'C类客户发货量',
    c_ratio_ticket_level   double COMMENT 'C类客户发件量占比',
    d_total_customer_level int COMMENT 'D类客户数',
    d_ratio_customer_level double COMMENT 'D类客户数据占比',
    d_total_ticket_level   int COMMENT 'D类客户发货量',
    d_ratio_ticket_level   double COMMENT 'D类客户发件量占比',
    e_total_customer_level int COMMENT 'E类客户数',
    e_ratio_customer_level double COMMENT 'E类客户数据占比',
    e_total_ticket_level   int COMMENT 'E类客户发货量',
    e_ratio_ticket_level   double COMMENT 'E类客户发件量占比',
    dorisdt                string COMMENT '为doris同步分区使用'
)
    COMMENT '各类发件客户数&贡献度对比'
    PARTITIONED BY ( dt STRING COMMENT '日期')
    STORED AS PARQUET
    LOCATION '/dw/hive/jms_dm.db/external/dm_diff_customer_deliver_and_contribution_ratio_dt'
    TBLPROPERTIES (
        'discover.partitions' = 'false',
        'parquet.column.index.access' = 'true'
        );